<!--
 * @Descripttion: 
 * @version: 
 * @Author: lsy
 * @Date: 2021-12-08 08:59:29
 * @LastEditors: lsy
 * @LastEditTime: 2021-12-17 13:42:16
-->
<template>
  <div class="login-container">
    <div class="logo_div">
      <img :src="loginConfig.loginLogo" width="50px" />
      {{ loginConfig.platName }}
    </div>
    <div style="float: right;color:white;margin-right: 50px;line-height:50px;">
      <a-popover>
        <template slot="content">
          <div style="font-weight:bold;line-height: 28px;">
            <div class="download_div" @click="openPath(loginConfig.plugInUnits[0].url)">
              <a-icon type="download" />&emsp;视频客户端
            </div>
            <div class="download_div" @click="openPath(loginConfig.plugInUnits[3].url)">
              <a-icon type="download" />&emsp;访客客户端
            </div>
          </div>
        </template>
        <a-button type="link">桌面客户端</a-button>
      </a-popover>
      <a-popover>
        <template slot="content">
          <qrcode :url="androidUrl" :qrcodeId="'Android_div'" />
        </template>
        <a-button type="link">Android App</a-button>
      </a-popover>
      <a-popover>
        <template slot="content">
          <qrcode :url="iosUrl" :qrcodeId="'ios_div'" />
        </template>
        <a-button type="link">IOS App</a-button>
      </a-popover>
    </div>
    <div class="login_content">
      <h1 style="color:white">HELLO,欢迎登录</h1>
      <login-content />
    </div>
  </div>
</template>
<script>
import qrcode from "./qrCode.vue"
import loginContent from "./loginContent.vue"
export default {
  name: "login",
  components: {
    loginContent, qrcode
  },
  data() {
    return {
      loginConfig: {},
      iosUrl: "",
      androidUrl: "",
    }
  },
  mounted() {
    VE_API.system.getBrmVersion().then(res => {
      localStorage.setItem("evo-brm", res.data.data.version)
      VE_API.system.getVersions().then(res => {
        let d = res.data.data.versionInfo;
        d.map(item => {
          localStorage.setItem(`${item.systemName}`, item.version)
        })
      })
      VE_API.system.getloginConfig().then(res => {
        localStorage.setItem("logo", res.data.data.loginLogo)
        localStorage.setItem("logoName", res.data.data.platName)
        this.loginConfig = res.data.data;
        this.androidUrl = this.loginConfig.plugInUnits[1].url
        this.iosUrl = this.loginConfig.plugInUnits[2].url
      })
    })
  },
  methods: {
    openPath(path) {
      window.open(path);
    },
  }
}
</script>
<style lang="scss" scoped>
.logo_div {
  float: left;
  display: flex;
  color: white;
  font-size: 25px;
  font-weight: bold;
  padding: 20px;
}
/* 背景 */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("./../../assets/images/loginBackground.jpg") no-repeat;
  background-size: cover;
  -webkit-background-size: cover;
  -o-background-size: cover;
  background-position: center 0;
  .ant-btn-link {
    color: rgb(207, 206, 206);
    &:hover {
      color: white;
    }
  }
  .login_content {
    width: 15%;
    position: absolute;
    right: 20%;
    top: 45%;
  }
}
.download_div {
  cursor: pointer;
  &:hover {
    color: rgb(67, 137, 230);
  }
}
</style>